/*****************************************************************
 *@Copyright all rights reserved © 2014 Yuga
 *@author Oplink OMS
 *Contact: zengkang007@gmail.com
 *****************************************************************/
package com.oplink.webems.modules.topo.entity;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.alibaba.fastjson.annotation.JSONField;
import com.oplink.webems.common.persistence.DataEntity;
import com.oplink.webems.modules.sys.entity.User;
/**
 * 告警Entity
 * @author Oplink OMS
 * @version 2014-09-01
 */
@Entity
@Table(name = "topo_topoentity")
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Topo extends DataEntity {
	
	private static final long serialVersionUID = 1L;
	@JSONField(serialize=false)
	private User user;
	private int sort; // 排序
	private Long topoid; // 主键
	private String content; // 登录名

    
	  public Long getTopoid() {
        return topoid;
      }
      
      public void setTopoid(Long topoid) {
        this.topoid = topoid;
      }
    
	  public String getContent() {
        return content;
      }
      
      public void setContent(String content) {
        this.content = content;
      }
    
    
    // JPA 基于USER_ID列的多对一关系定义
	@ManyToOne
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	} 
	
	@NotNull
	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}
}
